export const responsiveAdaptation = (score) => {
  try {
    const rootEl = document?.documentElement;
    function setRem(doc) {
      const width =
        doc.clientWidth || doc.offsetWidth || doc.getBoundingClientRect().width;
      const fontsize = Math.trunc(width / score);
      doc.style.fontSize = `${fontsize}px`;
    }

    if (rootEl) {
      window.addEventListener("resize", () => setRem(rootEl));
      setRem(rootEl);
    }
  } catch (error) {
    console.error("请在浏览器环境使用！！！");
  }
}